package com.yue.lin.repository;

import com.yue.lin.domain.Permission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;

public interface PermissionRepository extends JpaRepository<Permission, String> {

    @Query("select new Permission(p.id,p.des,p.code,p.pid,rp.op) from UserRoleMapper ur , RolePermissionMapper rp ,Permission p where ur.rid=rp.rid and p.id=rp.pid and ur.uid=?1")
    List<Permission> allPermissionByUid(String uid);
}